/*
 * @Author: kly812 konglingyu812@163.com
 * @Date: 2024-01-15 11:05:52
 * @LastEditors: kly812 konglingyu812@163.com
 * @LastEditTime: 2024-01-15 18:14:10
 * @FilePath: /mystl/MYSTL/test.cpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include <iostream>
#include "allocator.h"
#include <vector>
#include "vector.h"
//
void allocator_test()
{
    std::vector<int , mystl::allocator<int> > v1;
    for(int i=0;i<=5;i++)
    {
        v1.push_back(i);
    }
    for (auto &i : v1)
        std::cout << i << " ";
    std::cout << std::endl;
    v1.push_back(20);
    for(auto &i : v1)
    {
        std::cout << i <<" ";
    }
    std::cout << std::endl;
}
void test_vector()
{
    mystl::vector<int,mystl::allocator<int> > v2(10,10);
    for(auto &i : v2)
    {
        std::cout<<i<<" ";
    }
    std::cout << std::endl;
    v2.push_back(11);
    v2.push_back(12);
    v2.push_back(13);
    v2.push_back(14);
    v2.push_back(15);
    v2.push_back(16);
    for(auto &i : v2)
    {
        std::cout<<i<<" ";
    }
    std::cout << std::endl;

    v2.insert(v2.begin()+3,1);
    for(auto &i : v2)
    {
        std::cout<<i<<" ";
    }
    std::cout << std::endl;

}
int main()
{
    test_vector();
    return 0;
}